import { Excel } from '@ttou/midway-excel'
import { Exclude } from 'class-transformer'

/**
 * 角色导出序列化
 */
export class RoleExportSerialize implements ISysRoleEntity {
  @Excel({ header: '角色编号' })
  roleId: string

  @Excel({ header: '角色名称' })
  roleName: string

  @Excel({ header: '权限字符' })
  roleKey: string

  @Excel({ header: '显示顺序' })
  roleSort: number

  @Excel({ header: '状态' })
  status: string

  @Exclude()
  delFlag: string

  @Exclude()
  createBy: string

  @Excel({ header: '创建时间' })
  createTime: Date

  @Exclude()
  updateBy: string

  @Exclude()
  updateTime: Date

  @Excel({ header: '备注' })
  remark: string

  @Exclude()
  users: ISysUserEntity[]

  @Exclude()
  depts: ISysDeptEntity[]

  @Exclude()
  menus: ISysMenuEntity[]

  constructor(partial: any) {
    Object.assign(this, partial)
  }
}
